var maxArea = function(height) {
    if (height == null) {
       return 0;
     }
     let left = 0,
       right = height.length - 1;
     let result = 0;
       while(left < right){
          let x = Math.min(height[left],height[right])
          result =  Math.max(result,x * (right - left))
          if(height[left] <= height[right]){
              left++
          }else{
              right--
          }
       }
       return result
   };